if (typeof Quibbox == "undefined") var Quibbox = {};

Quibbox.Config = function ()
{
	var settings;
	
	if (quibboxInitConfig === undefined) quibboxInitConfig = {};
	settings = quibboxInitConfig;
	delete quibboxInitConfig;
	
	return {
		get: function (setting, def)
		{
			if (def === undefined) def = null;
			
			if (settings[setting] !== undefined) {
				return settings[setting];
			} else {
				return def;
			}
		},
		
		set: function (setting, value, persistent)
		{
			if (persistent === undefined) persistent = false;
			
			settings[setting] = value;
			
			if (persistent) {
				// TODO: Implement persistent setting RPC
			}
		}
	}
}();

Quibbox.Url = function ()
{
	
	
	return {
		local: function (url) {
			return Quibbox.Config.get('uri', '/') + url;
		}
	};
}();